import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/login/Login";
import Profile from "../views/profile/Profile";
import Picture from "../views/picture/Picture";
import Detail from "../views/picture/childCpn/Detail";
import PictureIndex from "../views/picture/PictureIndex";
import Upload from "../views/picture/childCpn/Upload";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect : "/login"
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/profile',
    name: 'Profile',
    component: Profile
  },
  {
    path: '/pictureIndex',
    name: 'PictureIndex',
    component: PictureIndex,
      children:[
        {
          path: '',
          redirect: '/picture'
        },
        {
          path:'/picture',
          component:Picture
        },
        {
          path:'upload',
          component:Upload
        },
      {
        path: 'detail',
        component: Detail
      }
    ]
  }
]

const router = new VueRouter({
  routes,
  mode:"history"
})

export default router
